Modern computer systems are increasingly employing multiple processor cores to satisfy the ever-greater demand for more computing power and capability, by incorporating one or more processors that each contains two or more “execution cores,” or computational engines, within the processor. A multi-core system can outperform a traditional single core system at similar clock rates because it can distribute work over multiple execution cores. Thus, a multi-core system is capable of performing more work within a given clock cycle, while avoiding issues that affect single core systems caused by limits in transistor design, power consumption, and heat generation.
A multi-core system is capable of multiprocessing, or concurrently executing separate threads of code, because the execution cores in the multi-core system can run software programs as discrete processors with all the associated execution resources. For example, the multi-core system can concurrently support a first thread running inside a process associated with a program and a second thread running from an operating system, or multiple threads running inside a single process. Multimedia and Web server applications are especially conducive to multiprocessing because many of their operations can run in parallel.
However, programs running on a multi-core system must be specifically designed to spread its workload across multiple execution cores to utilize the additional capabilities offered by the multi-core system. This functionality is called thread-level parallelism or “threading.” Applications, runtime environments (e.g., Java™ Runtime Environment by Sun Microsystems, Common Runtime Library by Microsoft Corp., and the like), and operating systems (e.g., Linux™, UNIX™, Open VMS™, Windows™ by Microsoft Corp., Sun Solaris™ by Sun Microsystems, Mac OS™ by Apple Computer, AIX™ by IBM, and the like) that are designed to support such functionality are referred to as “threaded” or “multi-threaded.” Unfortunately, designing programs that can take full advantage of multi-core system architectures and associated multi-threaded environments can be a difficult development challenge.
Typically, software developers adhere to an explicit threading model and thus develop multi-threaded programs that, during runtime, explicitly initiate threads and control the life-cycle of those threads. Software developers, however, face the challenge of developing programs that can create a sufficient number of threads to optimally utilize available execution cores and other resources without creating too many threads, which would cause expensive rescheduling and context switches. Moreover, programs developed using the explicit threading model can not properly scale to changes in the multi-core system architectures. Programs developed using explicit threading model in addition can not dynamically adjust to the workload of execution cores in a multi-core system, and can not dynamically coordinate allocation of the execution cores with other programs running on the multi-core system.
Attempts to overcome shortcomings of existing threading models include having a program and its processes determine available execution cores and other resources of the multi-core system prior to creating new threads, in order to avoid over-utilization of available resources. However, these attempts fall short because the program and its processes do not know the resource demands and requirements of other programs running in the system, and thus the program and its processes cannot coordinate resource allocation with the other programs. Furthermore, determining available execution cores and other resources typically require computationally expensive operations, such as system calls, which results in unnecessary and unacceptable performance penalty when multiple programs and their processes running in the multi-core system each attempts to determine available resources prior to creating new threads.
Therefore, there is a need to overcome these and other problems in the art to provide methods and systems for supporting and coordinating parallel execution of programs and processes associated with the programs between multiple execution cores in a multi-core system.